import { defineStore } from 'pinia'
import { flatDepts, mergeUserList } from '@/utils/dialog-utils.js'

const useContacts = defineStore('contacts', {
  state: () => {
    return {
      contactsData: [],
      deptTree: [],
      treeData: [],
    }
  },
  actions: {
    setContactsData(data) {
      this.contactsData = readonly(data)
    },
    setDeptTree(data) {
      this.deptTree = readonly(data)
    },
    setTreeData(data) {
      this.treeData = readonly(data)
    },
  },
})

export default useContacts
